package cn.csq;

/**
 * @author <a href="mailto:csq02198031@alibaba-inc.com">chengshanqing</a>
 * @date 2025/9/26 10:54
 */
public class ThreadSleepTest {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            System.out.println("start");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("end");
        });
        thread.start();

        Thread thread2 = new Thread(() -> {
            System.out.println("start 2");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("end 2");
        });
        thread2.start();

        synchronized (Main.class) {
            Main.class.wait();
        }
        thread.start();
    }
}
